Skip to main content

All Questions

Tagged with
1vote
3answers
224views

TDD - What to do when adding a new function on a dependency causes many previous tests to fail?

I was programming today and encountered something that just feels like I'm doing something wrong (maybe?). I've encountered this situation before, but I wanted to reach out and ask if there's a better ...
jrgilman's user avatar
-2votes
2answers
335views

Is it possible to write unit tests for embedded systems with no prior embedded programming knowledge?

I have this question for a long time that is it possible for someone with no prior embedded systems programming experience to write unit tests? I have good knowledge of other languages like JAVA, ...
deanavenger's user avatar
0votes
1answer
138views

Architectural pattern for testable C code [closed]

I wrote a lot of software in C# and Python. I tried to make the overall architecture testable by using the "Clean Architecture" and Dependency Injection. This works well for C# (and python). Now I ...
Kevin Meier's user avatar
-1votes
1answer
146views

static, dynamic analysis - what mistakes were made in the code?

A software company develops software packages for commercial animal farming. A special function in C calculates the daily amount of feed for different kind of animals dependent on their bodyweight....
tenepolis's user avatar
3votes
2answers
414views

malloc on different platforms

I am testing a red-black tree implementation (repository) and I find that with Windows 10 and gcc, malloc starts returning NULL after inserting approx. 50 million nodes but on Linux it works at least ...
Niklas Rosencrantz's user avatar
6votes
3answers
2kviews

Unit Testing Module-Internal Functions

I'm writing a simple whitebox unit testing suite for a project I'm working on in C. The project is broken into modules (each has a .c file with an associated .h file), and all modules are compiled ...
Woodrow Barlow's user avatar
6votes
1answer
275views

Strategies to increasing the maintainability of assertions in code [closed]

Background I am writing a compiler for a custom language for a school project and it is going really well for me. If I where to start all over from scratch I would have done many software ...
wefwefa3's user avatar
5votes
1answer
2kviews

How can I best test a multithreaded C producer-consumer program? [closed]

How does one best write tests for a multi-threaded producer-consumer C program? I know GDB can be used to debug threads, but I believe GDB also stops the thread currently being debugged while other ...
LazerSharks's user avatar
-2votes
1answer
295views

Which is the more testable C function implementation? [closed]

I write code in C. I have been striving to write more testable code but I am a little confused on deciding between writing pure functions that are really good for testing but require smaller functions ...
user110036's user avatar
8votes
1answer
343views

Suggested method for extracting a standalone C library from an existing R package?

My group has been developing an R package to simulate plant growth (see GitHub repository). The R package uses .Call to interface with C. We have decided that it would be worthwhile to create a ...
David LeBauer's user avatar
2votes
4answers
246views

Testing a file that relies heavily on a static array

I have a .c file that basically manages its own little database of people. There are add, remove, edit and search functions among some others. It has a static array which it uses to store the data. ...
Justin's user avatar
1vote
2answers
10kviews

How can I do test automation using a python script to test a c program?

I was wondering if I can use a Python script to test a C program automatically. Suppose I have a very simple C program which reads data (numbers as test cases) from the console, calculates them, then ...
Gnijuohz's user avatar
13votes
5answers
4kviews

How can I improve my error checking and handling?

Lately I have been struggling to understand what the right amount of checking is and what the proper methods are. I have a few questions regarding this: What is the proper way to check for errors (...
Anon's user avatar
  • 325
6votes
2answers
789views

Writing functional tests for a legacy project

I am trying to add a couple of tests to a legacy C project. The project basically consists of a command line tool that prints something to stdout every time an event happens. Now, since writing unit ...
user avatar

close